package com.derek.omshopping;/**
 * Created by ThinkPad on 2016/10/21.
 */

import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.derek.omshopping.base.BaseActivity;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 作者：ThinkPad on 2016/10/21 16:40
 * 邮箱：212740182@qq.com
 */
public class WebLoadActivity extends BaseActivity {

    @BindView(R.id.web_load)
    WebView webLoad;

    @Override
    public int getLayoutId() {
        return R.layout.activity_web_load;
    }
    @SuppressLint("SetJavaScriptEnabled")
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
        webLoad.getSettings().setJavaScriptEnabled(true);
        webLoad.setWebViewClient(new WebViewClient() {
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                return false;
            }
        });

        Intent intent = getIntent();
        if (intent != null) {
            String url = intent.getStringExtra("webLoadUrl");
            webLoad.loadUrl(url);

        }
    }}